<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />	
<link type="text/css" href="/css/1pxtable.css" rel="Stylesheet" />	
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<link rel="stylesheet" href="/js/chosen/chosen.css" />
</head>
<body style="font-family:Arial, Helvetica, sans-serif">
<h1>Download Unconfirmed Roster</h1>
<?php $managerList = unserialize(MANAGER_LIST);?>
<form action="" method="post">
<?php if($this->showpassword){?>
Currently unconfirmed roster unavailable
<?php /*?>
Input your attendance password : <input name="password" type="password" id="password" />
  <input type="submit" name="btn_check" id="btn_check" value="Check Password" />
*/ ?>
<h2>
  <?php } else {?>

<a target="_blank" href="/roster/manager-scan-etl-paper/id_mgr/<?php echo $this->idMgr ?>/token/<?php echo $this->token ?>">Please click Here Begin To Scan The Signed Paper</a></h2><br />
<br />

<strong style="color:#f99;font-size:24px;">X</strong>Signed Paper Not Return To You  | <strong style="color:#063;font-size:24px;">V</strong> Signed Paper Returned To You | <strong style="color:#ddd;font-size:24px;">O</strong> No Paper For This Staff This Cycle
<br />
<br />
Download All Button will add later <br />

<table  border="1" cellspacing="0" cellpadding="10" style="font-size:13px;">
  <tr>
  	<td>Manager</td>
    <td>Staff\Cycle</td>
    <?php foreach($this->arrCycle as $cycle){?>
    <td><?php echo $cycle?></td>
    <?php }?>
    <td>Delete</td>
  </tr>
  <?php foreach($this->arrStDetail as $id=> $detail){?>
  <tr>
  	<td><?php echo $managerList[$detail['manager']];?></td>
    <td><?php echo $detail['name']?></td>
    <?php foreach($this->arrCycle as $cycle){?>
    <td>
    <?php
    if(isset($this->arrRes[$detail['id']][$cycle])){
		
		
		
		//show download link 
		$line = $this->arrRes[$detail['id']][$cycle];
		
		if($line['time_scan']!='' && $line['mgr_scan']=='' ){
			
			echo '<strong style="color:#ddd;font-size:24px;">O</strong>';
			
			}else{
					echo "<div style=\"padding:10px;\"><a href=\"/timesheet_export/{$line['file_name']}\"><img src=\"/im/d_icon.gif\" border = \"0\" title = \"Downloald\"></a></div>";
		
		//show scan back 
		if($line['mgr_scan'] == ''){
			echo '<div style="padding:10px;"><strong style="color:#f99;font-size:24px;">X</strong></div>';
			}
		else{
			echo '<div style="padding:10px;"><strong style="color:#063;font-size:24px;">V</strong></div>';
			}	
				
				}
		}
	else{
		echo '<strong style="color:#ddd;font-size:24px;">O</strong>';
		}	
	
	?>
    </td>
     <?php }?>
     <td><input type = "submit" name = "submit[<?php echo $detail['id']?>]" value = "X" ></input></td>
  </tr>
  <?php }?>
</table>

<?php }?>


<div style=" font-size:10px; color:#666;float:left;" >Developer:Norman,Date:2015-01-28</div>
</form>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
  <script src="/js/chosen/chosen.jquery.js" type="text/javascript"></script>
  <script type="text/javascript"> 
    var config = {
      '.chzn-select': {allow_single_deselect:true},
    }
    for (var selector in config) {
      $(selector).chosen(config[selector]);
    }
  </script>
</body>
</html>
